package org.dubnation.car.controller;

import org.dubnation.base.util.AjaxResult;
import org.dubnation.base.util.PageInfo;
import org.dubnation.car.esdoc.CarDoc;
import org.dubnation.car.query.CarDocQuery;
import org.dubnation.car.service.ICarDocService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/carDoc")
public class CarDocController {

    @Autowired
    private ICarDocService carDocService;

    /**
     * 分页查询es中的数据
     * @param carDocQuery
     * @return
     */
    @PostMapping
    public AjaxResult queryPage(@RequestBody CarDocQuery carDocQuery) {
        PageInfo<CarDoc> carDocPageInfo = carDocService.queryPage(carDocQuery);
        return AjaxResult.me().setData(carDocPageInfo);
    }
}
